package com.xing.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by Bradish7Y on 2017/8/23.
 * 应用层错误统一处理
 */
@Controller
public class ErrorController {
    public static final Logger log = LoggerFactory.getLogger(ErrorController.class);

    @RequestMapping("/error/{code}")
    public String error(Model model, @PathVariable int code) {
        String view = "/error/error";
        model.addAttribute("msg", "has error");

        return view;
    }
}
